﻿using LJX.SmartPark.Common.ResponseOutput;
using LJX.SmartPark.Domain.SafeManage.PatrolPerson;
using LJX.SmartPark.Domain.SafeManage.plan;
using LJX.SmartPark.Service.SafeManage;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static LJX.SmartPark.Service.SafeManage.PatrolPersonServeice;
using static LJX.SmartPark.Service.SafeManage.PatrolplanServeice;

namespace LJX.SmartPark.WebApi.Controllers.SafeManage
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "SafeManage")]
    public class PatrolplanController : ControllerBase
    {
        private readonly IPatrolplanServeice _patrolplanServeice;

        public PatrolplanController(IPatrolplanServeice patrolplanServeice)
        {
            _patrolplanServeice = patrolplanServeice;
        }

        /// <summary>
        /// 获取总条数
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public int GetCount()
        {
            return _patrolplanServeice.GetCount();
        }

        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public Response<List<Patrolplan>> GetPatrolplanAsync(FyPlan fyPlan)
        {
            var result = _patrolplanServeice.GetPatrolplanAsync(fyPlan);
            return result.Result;
        }

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Response<Patrolplan> GetPatrolplanById(Patrolplan input)
        {
            var result = _patrolplanServeice.GetPatrolplanById(input);
            return result;
        }
    }
}
